package com.example.tys.baseapplication.net_tcp.frame.core;

import java.io.Closeable;
import java.io.IOException;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.TimeoutException;

/**
 * @author tys
 * @date 2019/4/29
 */

public interface IClient<Request, Response> extends Closeable {

    /**
     * 发送消息(阻塞方法)
     *
     * @param request
     * @param timeOutMillis
     * @return 响应结果
     * @throws IOException
     * @throws InterruptedException
     * @throws TimeoutException
     */
    Response send(Request request, int timeOutMillis) throws TimeoutException, InterruptedException, RejectedExecutionException, IOException;


}
